package com.real8.plusplayground.client.activity;

import com.google.api.gwt.services.plus.shared.model.Activity;
import com.google.gwt.editor.client.Editor;
import com.google.gwt.editor.client.SimpleBeanEditorDriver;
import com.google.gwt.user.client.ui.IsWidget;

/**
 * A readonly view of a Google+
 * {@link com.google.api.gwt.services.plus.shared.model.Activity}
 * <p>
 * (note: do not confuse this with a GWT activity
 * {@link com.google.gwt.activity.shared.Activity})
 * 
 * @author Rutger van der Eijk
 * 
 */
public interface ActivityReadView extends Editor<Activity>, IsWidget {
	/**
	 * The presenter for this view.
	 */
	public interface Presenter {
		/**
		 * Fired when new activityId is entered by the user
		 */
		void onIdChange(String activityId);
	}

	/**
	 * Set the {@link Presenter} for this view.
	 * 
	 * @param presenter
	 *            the presenter
	 */
	void setPresenter(Presenter presenter);

	/**
	 * Get the driver used to edit activities in the view.
	 */
	SimpleBeanEditorDriver<Activity, ?> getEditorDriver();

	/**
	 * Set (only) the id of the activity
	 * 
	 * @param activityId
	 */
	void setId(String activityId);
}
